package com.example.renttest.main.fragment;


import android.app.LocalActivityManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;

import com.example.renttest.R;


/**
 * A simple {@link Fragment} subclass.
 */
public class SereachFragment extends Fragment {
    private Button button;
    private EditText editText;
    public SereachFragment() {
        // Required empty public constructor
    }
    View view;
    LocalActivityManager localActivityManager;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view=inflater.inflate(R.layout.fragment_sereach, container, false);
                localActivityManager = new LocalActivityManager(getActivity(), true);
        localActivityManager.dispatchCreate(savedInstanceState);
        view = localActivityManager.startActivity("1", new Intent(
                getActivity(),
                shopCartActivity.class
        )).getDecorView();
        return view;
    }

    @Override
    public void onHiddenChanged(boolean hidden) {
        super.onHiddenChanged(hidden);
        if (hidden) {

        } else {
            shopCartActivity shopCartActivity = (com.example.renttest.main.fragment.shopCartActivity) localActivityManager.getActivity("1");

            shopCartActivity.loadData();
        }
    }
}
